//package lt.hsu.security;
//
//import org.springframework.stereotype.Component;
//
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * JWT内容增强器
// * Created by macro on 2020/6/19.
// */
//@Component
//public class JwtTokenEnhancer implements TokenEnhancer {
//    @Override
//    public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) {
//        SecurityUser securityUser = (SecurityUser) authentication.getPrincipal();
//        Map<String, Object> info = new HashMap<>();
//        //把用户ID设置到JWT中
//        info.put("id", securityUser.getId());
//        ((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(info);
//        return accessToken;
//    }
//}
